package java8.methodref;

import java.util.function.Supplier;

/**
 * @author 周宇
 * @create 2020-05-19 19:18
 * 实例方法引用
 */
public class InstanceReference {
    public static void main(String[] args) {
        InstanceReference instance = new InstanceReference();
        Employee employee = new Employee("张三棍", 003);
        Supplier<String> supplier = () -> employee.getEname();
        System.out.println("employee的getName():" + supplier.get());

        Supplier<String> supplier2 = employee::getEname;//实例方法引用
        System.out.println("employee2的getName():" + supplier.get());
    }
}
